Get file name in Shell

$ basename /the/path/to/thisfile.txt
thisfile.txt
$ basename thisfile.txt .txt
thisfile
$ basename /the/path/to/thisfile.txt .txt
thisfile

ref

Homepage
Comments

Hide Comments